#ifndef _Dealer
#define _Dealer

#include "../Common/Player.h"
#include "../Common/Exception.h"
#include "../Common/NetWorkInterface.h"
#include "Game.h"

#include <QApplication>
#include <iostream>
#include <sstream>
#include <string>
#include <QtGui>
#include <map>

class QtApp;
class Player;
class Exception;
class Game;

using namespace std;

class Dealer
{
	public:
		Dealer();
		// souvenir des Card précédement joué /
		map<int, Card> cards;
		map <int,Player> joueursMemoire;

		map <int,Player> runGame(string ipj1,string ipj2,string port1,string iport2,map <int,Card> &Cards,int s1,int s2);
		map <int,Card> initCards();
		void distributionFlop(Player &j1,Player &j2,map <int,Card> &cards);
		void distribution4(Player &j1,Player &j2,map <int,Card> &cards);
		void distribution5(Player &j1,Player &j2,map <int,Card> &cards);
		void distribution(Player &j1,Player &j2,map <int,Card> &cards);
		void distriblind(Player &j1,Player &j2);

		Game * initPartie();
		// nombre de partie ou l'on distribue les mêmes cards /
		int compteurDePartie ;
		int nbPartieAvantNouvelleDistribution;
		int pot;
		void FfinPartie(QtApp *app);
		void linkjoueur(QGridLayout *gridLayout,char **argvGolbal,QtApp *app) throw (Exception);
		void printCards(map <int,Card> &cards);
		void inversionPositionJoueur();
};

#endif
